﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using EMRI.EmergencyCare.Web.DataContext;
using EMRI.EmergencyCare.Web.Models;

namespace EMRI.EmergencyCare.Web.Helper
{
    public static class MasterDataHelper
    {
        private static readonly EmergencyManagementContext Db = new EmergencyManagementContext();

        public static IEnumerable<District> GetDistricts()
        {
            return Db.Districts.OrderBy(d => d.Name).ToList();
        }

        public static IEnumerable<Taluk> GetTaluks()
        {
            return Db.Taluks.OrderBy(t => t.Name).ToList();
        }

        public static IEnumerable<City> GetCity()
        {
            return Db.Cities.OrderBy(c => c.Name).ToList();
        }

        public static IEnumerable<string> GetCareBeforeEmRoomArrival()
        {
            return Db.CareBeforeRoom.Select(l => l.Name).OrderBy(l => l);
        }

        public static IEnumerable<string> GetBroughtBy()
        {
            return Db.BroughtBy.Select(e => e.Name).OrderBy(e => e);
        }

        public static IEnumerable<string> GetLocations()
        {
            return Db.Locations.Select(l => l.Name).OrderBy(l => l);
        }

        public static IEnumerable<string> GetEmergencyTypes()
        {
            return Db.EmergencyTypes.Select(e => e.Name).OrderBy(e => e);
        }

        public static IEnumerable<string> GetCauseEmergency()
        {
            return Db.CauseEmergencies.Select(e => e.Name).OrderBy(e => e);
        }

        public static IEnumerable<string> GetMechanismInjury()
        {
            return Db.MechanismInjuries.Select(e => e.Name).OrderBy(e => e);
        }

        public static IEnumerable<string> GetAnatomical()
        {
            return Db.AnatomicalEmergencies.Select(e => e.Name).OrderBy(e => e);
        }

        public static IEnumerable<string> GetIncidentLocation()
        {
            return Db.IncidentLocations.Select(e => e.Name).OrderBy(e => e);
        }

        public static IEnumerable<string> GetChiefComplaint()
        {
            return Db.CheifComplaints.Select(e => e.Name).OrderBy(e => e);
        }

        public static IEnumerable<string> GetDoctorlist()
        {
            return Db.DoctorsList.Select(e => e.Name).OrderBy(e => e);
        }

        public static IEnumerable<string> GetSocialHabit()
        {
            return Db.SocialHabits.Select(e => e.Name).OrderBy(e => e);
        }

        public static IEnumerable<string> GetMCI()
        {
            return Db.MCIs.Select(e => e.Name).OrderBy(e => e);
        }

        public static IEnumerable<string> GetHospitalList()
        {
            return Db.HospitalsList.Select(e => e.Name).OrderBy(e => e);
        }
        public static IEnumerable<string> GetParamedicList()
        {
            return Db.Paramedicslist.Select(e => e.Name).OrderBy(e => e);
        }

    }
}